package com.eshore.norm.util;

import java.util.Arrays;
import java.util.List;
import java.util.StringJoiner;

/**
 * TODO
 *
 * @author: v-chenjl62
 * @date: 2024/1/11 10:36
 */
public class ListStringUtils {
    public static String listToString(List<String> list){
        StringJoiner joiner = new StringJoiner(",");
        for (String item : list) {
            joiner.add(item);
        }
        return joiner.toString();
    }

    public static List<String> stringToList(String str){
        String[] items = str.split(",");
        return Arrays.asList(items);
    }
}
